package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.UserTermsMapper;
import com.ruoyi.manage.domain.UserTerms;
import com.ruoyi.manage.service.IUserTermsService;

/**
 * 用户条款Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-08
 */
@Service
public class UserTermsServiceImpl implements IUserTermsService 
{
    @Autowired
    private UserTermsMapper userTermsMapper;

    /**
     * 查询用户条款
     * 
     * @param id 用户条款ID
     * @return 用户条款
     */
    @Override
    public UserTerms selectUserTermsById(Long id)
    {
        return userTermsMapper.selectUserTermsById(id);
    }

    /**
     * 查询用户条款列表
     * 
     * @param userTerms 用户条款
     * @return 用户条款
     */
    @Override
    public List<UserTerms> selectUserTermsList(UserTerms userTerms)
    {
        return userTermsMapper.selectUserTermsList(userTerms);
    }

    /**
     * 新增用户条款
     * 
     * @param userTerms 用户条款
     * @return 结果
     */
    @Override
    public int insertUserTerms(UserTerms userTerms)
    {
        userTerms.setCreateTime(DateUtils.getNowDate());
        return userTermsMapper.insertUserTerms(userTerms);
    }

    /**
     * 修改用户条款
     * 
     * @param userTerms 用户条款
     * @return 结果
     */
    @Override
    public int updateUserTerms(UserTerms userTerms)
    {
        return userTermsMapper.updateUserTerms(userTerms);
    }

    /**
     * 批量删除用户条款
     * 
     * @param ids 需要删除的用户条款ID
     * @return 结果
     */
    @Override
    public int deleteUserTermsByIds(Long[] ids)
    {
        return userTermsMapper.deleteUserTermsByIds(ids);
    }

    /**
     * 删除用户条款信息
     * 
     * @param id 用户条款ID
     * @return 结果
     */
    @Override
    public int deleteUserTermsById(Long id)
    {
        return userTermsMapper.deleteUserTermsById(id);
    }
}
